package com.jeecms.pay.util;

import java.io.IOException;
import java.io.InputStream;

import com.jeecms.pay.model.PayLog;

/**
 * 
 * @author tiger
 * 
 */
public class HPropertiesUtil {

	public static HProperties read(String fileName) {
		HProperties properties = new HProperties();
		InputStream inStream = new HPropertiesUtil().getClass().getResourceAsStream("/" + fileName);
		try {
			properties.load(inStream);
			inStream.close();
		} catch (IOException e) {
			PayLog.logger.error("", e);
		}
		return properties;
	}

	public static void write(HProperties properties) {
		InputStream inStream = new HPropertiesUtil().getClass().getResourceAsStream("/payclient.properties");
		try {
			properties.write(inStream, properties);
		} catch (IOException e) {
			PayLog.logger.error("", e);
		}
	}
}
